package com.barks.learning.base.controller;

import com.barks.learning.base.excetion.CustomException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chenw-i
 * @version 1.0.0
 * @ClassName DemoController.java
 * @Description TODO
 * @createTime 2020年07月11日 18:30:00
 */

@RestController
public class DemoController {
    @GetMapping("/get")
    public String get(){
        return "get success";
    }

    /**
     * 处理异常情况
     * @return
     */
    @GetMapping("/exception")
    public String exception(){
        throw new CustomException();
    }
}
